//
<template>
  <el-popover placement="left" :width="300" trigger="click">
    <template #reference>
      <el-button title="新建" type="primary" circle  class="add-button"><SvgIcon name="ele-Plus"></SvgIcon></el-button>
    </template>
    <div class="popover-content">
      <el-divider>工程管理</el-divider>
      <div v-for="(item , index) in eng_tec" :key="index"><vp-btn class="w100"  text @click="handleOpen(item.route)"><vp-label :zh="item.zh" :en="item.en"/></vp-btn></div>
      <el-divider>生产控制</el-divider>
      <div v-for="(item , index) in produce" :key="index">
        <vp-btn class="w100"  text @click="handleOpen(item.route)"><vp-label :zh="item.zh" :en="item.en"/></vp-btn>
      </div>
      <el-divider>质量管理</el-divider>
      <div v-for="(item , index) in quality" :key="index" >
        <vp-btn class="w100" text @click="handleOpen(item.route)"><vp-label :zh="item.zh" :en="item.en"/></vp-btn>
      </div>
      <el-divider>安全管理</el-divider>
      <div v-for="(item , index) in safety" :key="index">
        <vp-btn class="w100"  text @click="handleOpen(item.route)"><vp-label :zh="item.zh" :en="item.en"/></vp-btn>
      </div>
      <el-divider>生产保障</el-divider>
      <div v-for="(item , index) in pa" :key="index">
        <vp-btn class="w100"  text @click="handleOpen(item.route)"><vp-label :zh="item.zh" :en="item.en"/></vp-btn>
      </div>
    </div>
  </el-popover>
</template>
<script setup lang="ts" name="AddForm">
import { ref } from 'vue';
import { useRouter } from 'vue-router';
  const router = useRouter();

  const eng_tec = ref([
    {
      "zh": "项目开发申请表",
      "en": "Project Dev Apply Form",
      "route": "addProjectDevApplyForm"
    },
    {
      "zh": "鉴定试验大纲",
      "en": "Qualification Test Plan",
      "route": "addEngTecQualificationTestPlan"
    },
    {
      "zh": "鉴定试验报告",
      "en": "Qualification Test Report",
      "route": "addEngTechQualificationTestReport"
    },
    {
      "zh": "修理规范审定计划",
      "en": "Repair Spec Cert Process",
      "route": "addEngTechRepairSpecCertProcess"
    },
    {
      "zh": "适航条款符合性说明",
      "en": "Airworthiness Confm Stmt",
      "route": "addEngTechAirworthinessConfmStmt"
    },
    {
      "zh": "修理规范",
      "en": "Repair Spec",
      "route": "addEngTechRepairSpec"
    },
    {
      "zh": "可靠性分析报告",
      "en": "Reliability Analysis Report",
      "route": "addEngTechReliabilityAnalysisReport"
    },
    {
      "zh": "符合性总结报告",
      "en": "Conformance Summary Report",
      "route": "addEngTechConformanceSummaryReport"
    },
    {
      "zh": "超规范修理方案开发申请表",
      "en": "Proj Dev Bsrs Apply",
      "route": "addEditEngTechBSRSDevApply"
    },
    {
      "zh": "工具设备等效评估",
      "en": "TTE Eqv Eval",
      "route": "addEngTechTteEqyivalentEval"
    },
    {
      "zh": "工具设备等效文件",
      "en": "TTE Eqv Doc",
      "route": "addEngTechTTEEqvDoc"
    },
    {
      "zh": "化工品耗材等效评估",
      "en": "CCM Eqv Eval",
      "route": "addEngTechCCMEqvEval"
    },
    {
      "zh": "化工品耗材等效文件",
      "en": "CCM Eqv Doc",
      "route": "addEngTechCCMEqvDoc"
    },
    {
      "zh": "工艺",
      "en": "Repair Process",
      "route": "addEngTecRepairProcess"
    },
    {
      "zh": "工卡",
      "en": "Job Card",
      "route": "addEngTecWorkCard"
    },
    {
      "zh": "工装设计加工验收",
      "en": "Contract Maintenance Application",
      "route": "AddSTDesignMachiningAccept"
    },
  ]);
  const produce = ref([
    {
      "zh": "内部维修委托",
      "en": "Internal Maintenance Application",
      "route": "addMaintApply"
    },
    {
      "zh": "外部维修委托",
      "en": "Contract Maintenance Application",
      "route": "addMaintApplyContract"
    },
    {
      "zh": "附件初检报告",
      "en": "Component Pre. Insp. Report",
      "route": "addPreInspReport"
    },
    {
      "zh": "维修方案确认单",
      "en": "MP Confirm Sheet",
      "route": "addMPConfirm"
    },
    {
      "zh": "附件修理报告",
      "en": "MP Confirm Sheet",
      "route": "addMaintenanceReport"
    },
    {
      "zh": "附件退件单",
      "en": "Compliance Check",
      "route": "addComponentReturn"
    },
  ]);
  const quality = ref([
    {
      "zh": "教员授权申请",
      "en": "Teacher Auth Apply",
      "route": "addTeacherAuthApply"
    },
    {
      "zh": "岗位授权申请",
      "en": "Post Auth Apply",
      "route": "addPostAuthApply"
    },
    {
      "zh": "手册程序",
      "en": "Manual",
      "route": "addManualRevision"
    },
    {
      "zh": "审核计划",
      "en": "Audit Plan",
      "route": "addAuditPlan"
    },
    {
      "zh": "审核项目检查单",
      "en": "Audit CheckList",
      "route": "addAuditCheckList"
    },
    {
      "zh": "发现问题通知单",
      "en": "Audit Finding",
      "route": "addAuditFinding"
    },
    {
      "zh": "审核报告",
      "en": "Audit Report",
      "route": "addAuditReport"
    },
    {
      "zh": "外审通知",
      "en": "External Notification",
      "route": "addAuditExtNotice"
    },
    {
      "zh": "日常督查",
      "en": "Routine Supervision",
      "route": "addAuditRoutineSupervision"
    },
    {
      "zh": "事件调查",
      "en": "Incident Investigation",
      "route": "addAuditIncidentInvestigation"
    },
    {
      "zh": "客户投诉",
      "en": "Customer Complaint",
      "route": "addCustomerComplaint"
    },
    {
      "zh": "索赔报告",
      "en": "Compliance Check",
      "route": "addProduceClaimReport"
    },
    {
      "zh": "非计划计量申请",
      "en": "Unplan Calibration Apply",
      "route": "addPaUnplanCalibrationApply"
    },
    {
      "zh": "计量周期调整申请",
      "en": "Calibration Adjust Apply",
      "route": "addPaCalibrationAdjustApply"
    },
  ]);
  const safety = ref([
    {
      "zh": "系统与工作分析",
      "en": "System And Work Analysis",
      "route": "addSafetyRiskWorkAnalysis"
    },
    
    {
      "zh": "不安全事件报告",
      "en": "Unsafe Event Report",
      "route": "addUnsafeEventReport"
    },
    {
      "zh": "自我检查",
      "en": "Self Check",
      "route": "addSelfCheck"
    },
    {
      "zh": "安全监督检查",
      "en": "Supervision Check",
      "route": "addSupervisionCheck"
    },
    {
      "zh": "自愿报告",
      "en": "Voluntary Report",
      "route": "addVoluntaryReport"
    },
    {
      "zh": "系统评价报告",
      "en": "System Assessment Report",
      "route": "addSysAssessmentReport"
    },
    {
      "zh": "法定自查",
      "en": "Compliance Check",
      "route": "addComplianceCheck"
    },
  ]);
  const pa = ref([
    {
      "zh": "调试验收记录",
      "en": "CCM Eqv Eval",
      "route": "addPaDebugAcceptance"
    },
    {
      "zh": "设备授权申请",
      "en": "Equipment Auth Apply",
      "route": "addPaEquipmentAuthApply"
    },
  ]);
  const handleOpen = (route: string) => {
    router.push({
		  name: route,
	});
  };
</script>
<style scoped lang="scss">
.add-button { 
  position: fixed;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  z-index: 999 !important;
}
.popover-content  {
  // width: 250px;
  overflow-y: auto;
  height: 50vh;
}
</style>